<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/struts-dojo-tags" prefix="sx" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>青鸟租房 -发布房屋信息</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/uploadify.css" />
<script type="text/javascript" src="scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="scripts/function.js"></script>
<script type="text/javascript">
$(function(){
	$("#district").change(function(){
		$.post("ajax/getStreets.action",$("#district").serialize(),function(data){
			data = eval("(" + data + ")");
			var str = "";
			$.each(data,function(i,n){
				str = str.concat("<option value='" + n.id + "'>" + n.name + "</option>");
			});
			$("#street").html($(str));
		},"json");
	});
	$("#district").trigger("change");
});
 $(document).ready(function() {
            $("#uploadify").uploadify({
            	height:30,
       			swf:'uploadify.swf',
       			uploader:'filter/upload.action',
       			formData:{'sessionId':'<%=session.getId() %>'},
       			fileObjName:'uploadify',
       			uploadLimit:1,
       			fileSizeLimit:'100KB',
       			multi:false,
       			auto:true,
       			buttonText:'上传图片',
       			fileTypeExts: '*.gif; *.jpg; *.png',
       			fileTypeDesc:'Image Files',
       			removeCompleted:false,
       			width:120
        
            	/*
            	'debug' :true,
                'cancelImg'      : 'image/cancel.png',//取消上传文件的按钮图片
                'queueID'        : 'fileQueue',
                */
            });
        });
</script>
</head>
<body>
<div id="header" class="wrap">
	<div id="logo"><img src="images/logo.gif" /></div>

</div>
<div id="regLogin" class="wrap">
	<div class="dialog">
		<dl class="clearfix">
			<dt>新房屋信息发布</dt>
			<dd class="past">填写房屋信息</dd>
		</dl>
		<div class="box">
			<s:fielderror/>
			<form id="form" action="filter/publish.action" method="post" enctype="multipart/form-data">
				<div class="infos">
					<table class="field">
						<tr>
							<td class="field">标　　题：</td>
							<td>
								<input class="text" name="title" type="text"/>
							</td>
						</tr>
						<tr>
							<td class="field">房　　型：</td>
							<td><select class="text" name="houseTypeId">
									<s:iterator value="houseTypes">
										<option value="<s:property value="id" />">
											<s:property value="name" />
										</option>
									</s:iterator>
								</select>
							</td>
						</tr>
						<tr>
							<td class="field">面　　积：</td>
							<td><input class="text" name="floorage" type="text"/></td>
						</tr>
						<tr>
							<td class="field">价　　格：</td>
							<td>
							<input class="text" name="price" type="text"/>
							</td>
						</tr>
						 
                        <tr>
							<td class="field">位　　置：</td>
							<td>区：<select  class="text" name="districtId" id="district">
										<s:iterator value="districts">
											<option value="<s:property value="id" />">
												<s:property value="name" />
											</option>
										</s:iterator>
									</select>
                            	街：<select class="text" name="streetId" id="street">
                            		</select>
                            </td>
						</tr>
						
						<tr>
							<td class="field">类　　型：</td>
							<td><select class="text" name="typeId">
									<s:iterator value="types">
										<option value="<s:property value="id" />">
											<s:property value="name" />
										</option>
									</s:iterator>
								</select>
							</td>
						</tr>
                        <tr>
							<td class="field">联系方式：</td>
							<td>
							<input type="text" class="text" name="contact" />
							</td>
						</tr>
                        <tr>
							<td class="field">详细信息：</td>
							<td><textarea name="description"></textarea></td>
						</tr>
						<tr>
							<td class="field">房屋照片：</td>
							<td>
								<input type="file" name="uploadify" id="uploadify" />
							</td>
						</tr>
						<!--<tr>
							<td class="field">房屋照片：</td>
							<td>
								<input name="attachment" type="file" />
							</td>
						</tr>
					--></table>
					<div class="buttons">
						<input type="submit" value="立即发布"/>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<div id="footer" class="wrap">
	<dl>"C:/Users/Administrator/Desktop/top.swf"
    	<dt>青鸟租房 &copy; 2010 北大青鸟 京ICP证1000001号</dt>
        <dd>关于我们 · 联系方式 · 意见反馈 · 帮助中心</dd>
    </dl>
</div>
</body>
</html>